home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 15705 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.1 KB  |  27 lines

  1. Newsgroups: comp.lang.c++
  2. Path: presby.edu!jtbell
  3. From: jtbell@presby.edu (Jon Bell)
  4. Subject: Re: What are the differences between structures and classes in C++ ?
  5. Message-ID: <DpHxrw.8u9@presby.edu>
  6. Date: Sun, 7 Apr 1996 14:33:32 GMT
  7. References: <4k5m65$av@hpscit.sc.hp.com> <DpG53J.Hsz@presby.edu> <4k83j3$a56@hpscit.sc.hp.com> <marnoldDpHvED.E0t@netcom.com>
  8. Organization: Presbyterian College, Clinton, South Carolina USA
  9.  
  10.  Matt Arnold <marnold@netcom.com> wrote:
  11. >Structs can inherit from other structs and classes and can be inherited
  12. >by other structs and classes.  Structs can have virtual functions, member 
  13. >operators, constructors and destructors, you can create template structs,
  14. >and so on.
  15. >
  16. >In other words, structs *are* classes.
  17.  
  18. Just now I took a sample program which uses inheritance and simply 
  19. changed all the classes to structs, making sure that public/private was 
  20. always specified explicitly.
  21.  
  22. The "structified" program compiled and ran exactly like the original.
  23.  
  24. -- 
  25. Jon Bell <jtbell@presby.edu>                        Presbyterian College
  26. Dept. of Physics and Computer Science        Clinton, South Carolina USA
  27.